<!-- html -->
<template>
  <button class="button1" @click="changeParentText($parent)">修改父组件内容</button>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
  name: 'exposeTest2Child3'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
//方法
function changeParentText(parent: any) {
  parent.text += '-'
}
</script>

<!-- 样式 -->
<style scoped></style>